package com.hcbd.tdwt.ui.fuda.common.vo.weather;

/**
 * 天气类型
 *
 * @author ZhDZ
 * @Date 2019年7月29日
 */
public enum WeatherCodeType {
    SunnyClear(100, "晴"),
    Cloudy(101, "多云"),
    FewClouds(102, "少云"),
    PartlyCloudy(103, "晴间多云"),
    Overcast(104, "阴"),
    Windy(200, "有风"),
    Calm(201, "平静"),
    LightBreeze(202, "微风"),
    ModerateGentleBreeze(203, "和风"),
    FreshBreeze(204, "清风"),
    StrongBreeze(205, "强风/劲风"),
    HighWind(206, "疾风"),
    Gale(207, "大风"),
    StrongGale(208, "烈风"),
    Storm(209, "风暴"),
    ViolentStorm(210, "狂爆风"),
    Hurricane(211, "飓风"),
    Tornado(212, "龙卷风"),
    TropicalStorm(213, "热带风暴"),
    ShowerRain(300, "阵雨"),
    HeavyShowerRain(301, "强阵雨"),
    Thundershower(302, "雷阵雨"),
    HeavyThunderstorm(303, "强雷阵雨"),
    Thundershowerwithhail(304, "雷阵雨伴有冰雹"),
    LightRain(305, "小雨"),
    ModerateRain(306, "中雨"),
    HeavyRain(307, "大雨"),
    ExtremeRain(308, "极端降雨"),
    DrizzleRain(309, "毛毛雨/细雨"),
    RainsStorm(310, "暴雨"),
    HeavyStorm(311, "大暴雨"),
    SevereStorm(312, "特大暴雨"),
    FreezingRain(313, "冻雨"),
    Lighttomoderaterain(314, "小到中雨"),
    Moderatetoheavyrain(315, "中到大雨"),
    Heavyraintostorm(316, "大到暴雨"),
    Stormtoheavystorm(317, "暴雨到大暴雨"),
    Heavytoseverestorm(318, "大暴雨到特大暴雨"),
    Rain(399, "雨"),
    LightSnow(400, "小雪"),
    ModerateSnow(401, "中雪"),
    HeavySnow(402, "大雪"),
    Snowstorm(403, "暴雪"),
    Sleet(404, "雨夹雪"),
    RainAndSnow(405, "雨雪天气"),
    ShowerSnow(406, "阵雨夹雪"),
    SnowFlurry(407, "阵雪"),
    Lighttomoderatesnow(408, "小到中雪"),
    Moderatetoheavysnow(409, "中到大雪"),
    Heavysnowtosnowstorm(410, "大到暴雪"),
    Snow(499, "雪"),
    Mist(500, "薄雾"),
    Foggy(501, "雾"),
    Haze(502, "霾"),
    Sand(503, "扬沙"),
    Dust(504, "浮尘"),
    Duststorm(507, "沙尘暴"),
    Sandstorm(508, "强沙尘暴"),
    Densefog(509, "浓雾"),
    Strongfog(510, "强浓雾"),
    Moderatehaze(511, "中度霾"),
    Heavyhaze(512, "重度霾"),
    Severehaze(513, "严重霾"),
    Heavyfog(514, "大雾"),
    Extraheavyfog(515, "特强浓雾"),
    Hot(900, "热"),
    Cold(901, "冷"),
    Unknown(999, "未知");

    private int code;
    private String name;

    private WeatherCodeType(int code, String name) {
        this.code = code;
        this.name = name;
    }

    public static WeatherCodeType get(int c) {
        for (WeatherCodeType w : WeatherCodeType.values()) {
            if (w.getCode() == c) {
                return w;
            }
        }
        return SunnyClear;
    }

    public static WeatherCodeType get(String n) {
        for (WeatherCodeType w : WeatherCodeType.values()) {
            if (w.getName().equals(n)) {
                return w;
            }
        }
        return SunnyClear;
    }

    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

}
